//
//  LGReportHolderHeaderView.m
//  HeartDiseaseManage
//
//  Created by 1234 on 2023/9/1.
//

#import "LGReportHolderHeaderView.h"

@interface LGReportHolderHeaderView()
/**   */
@property (nonatomic , strong)UIView *baseView;
/**   */
@property (nonatomic , strong)UIButton *titleBtn;
/**   */
@property (nonatomic , strong)UIView *formView;
/**   */
@property (nonatomic , strong)UIView *segmentView;
/**   */
@property (nonatomic , strong)UILabel *titleLabel;
/**   */
@property (nonatomic , strong)UILabel *contentLabel;

@end

@implementation LGReportHolderHeaderView

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.clipsToBounds = YES;
        self.backgroundColor = [UIColor clearColor];
        [self addSubview:self.baseView];
        [self.baseView addSubview:self.titleBtn];
        [self.baseView addSubview:self.formView];
        [self.baseView addSubview:self.segmentView];
        [self.baseView addSubview:self.titleLabel];
        [self.baseView addSubview:self.contentLabel];
    }
    return self;
}

-(UIView *)baseView{
    if(!_baseView){
        _baseView = [UIView shadowViewWithColor:@"#B3C5D9" offset:CGSizeMake(0, 2) opacity:0.1 radius:15];
        _baseView.frame = CGRectMake(viewPix(16), viewPix(8), Screen_W-viewPix(32), viewPix(100));
        _baseView.backgroundColor = [UIColor whiteColor];
    }
    return _baseView;
}

-(UIButton *)titleBtn{
    if(!_titleBtn){
        _titleBtn = [UIButton buttonWithTitle:@"支架信息" titleFont:LGFontWeight(16, UIFontWeightMedium) textColor:@"#1F6CC6" imageName:@""];
        [_titleBtn setBackgroundImage:[UIImage imageNamed:@"就诊检查-蓝色"] forState:UIControlStateNormal];
        _titleBtn.frame = CGRectMake(0, viewPix(16), 112, 27);
        _titleBtn.userInteractionEnabled = NO;
    }
    return _titleBtn;
}

-(UIView *)formView{
    if(!_formView){
        _formView = [[UIView alloc] initWithFrame:CGRectMake(viewPix(12), viewPix(55), Screen_W-viewPix(56), viewPix(40))];
        _formView.layer.borderColor = [UIColor colorWithString:@"#E0E0E0"].CGColor;
        _formView.layer.borderWidth = 1.0;
        _formView.cornerRidus = 7;
    }
    return _formView;
}

-(UIView *)segmentView{
    if(!_segmentView){
        _segmentView = [[UIView alloc] initWithFrame:CGRectMake(kMaxX(self.titleLabel.frame), viewPix(55), 0.5, viewPix(40))];
        _segmentView.backgroundColor = [UIColor colorWithString:@"#E0E0E0"];
    }
    return _segmentView;
}

-(UILabel *)titleLabel{
    if(!_titleLabel){
        _titleLabel = [UILabel lableWithText:@"支架部位" colorString:@"#666666" textFont:LGFont(12) textAlignment:NSTextAlignmentCenter lines:1];
        _titleLabel.frame = CGRectMake(0, viewPix(55), (Screen_W-viewPix(56))/2.0, viewPix(36));
    }
    return _titleLabel;
}

-(UILabel *)contentLabel{
    if(!_contentLabel){
        _contentLabel = [UILabel lableWithText:@"支架数量" colorString:@"#666666" textFont:LGFont(12) textAlignment:NSTextAlignmentCenter lines:1];
        _contentLabel.frame = CGRectMake(kMaxX(self.titleLabel.frame), viewPix(55), (Screen_W-viewPix(56))/2.0, viewPix(36));
    }
    return _contentLabel;
}

@end
